gate linear algebra